package com.momo.mapper.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.momo.mapper.dataobject.SequenceInfoDO;
import com.momo.mapper.mapper.SequenceInfoDOMapper;

/**
* The Table SEQUENCE_INFO.
* 注意:此结构有系统生成,禁止手工修改,以免被覆盖,请通过dalgen生成
* SEQUENCE_INFO
*/
@Repository
public class SequenceInfoDAO{

    @Autowired
    private SequenceInfoDOMapper sequenceInfoDOMapper;

    /**
     * desc:插入表:SEQUENCE_INFO.<br/>
     * descSql =  SELECT LAST_INSERT_ID() INSERT INTO SEQUENCE_INFO( NAME STEP ,CURRENT_VALUE )VALUES( #{name,jdbcType=VARCHAR} #{step,jdbcType=INTEGER} ,#{currentValue,jdbcType=INTEGER} )
     * @param entity entity
     * @return int
     */
    public int insert(SequenceInfoDO entity){
        return sequenceInfoDOMapper.insert(entity);
    }
    /**
     * desc:更新表:SEQUENCE_INFO.<br/>
     * descSql =  UPDATE SEQUENCE_INFO SET STEP = #{step,jdbcType=INTEGER} ,CURRENT_VALUE = #{currentValue,jdbcType=INTEGER} WHERE NAME = #{name,jdbcType=VARCHAR}
     * @param entity entity
     * @return int
     */
    public int update(SequenceInfoDO entity){
        return sequenceInfoDOMapper.update(entity);
    }
    /**
     * desc:根据主键删除数据:SEQUENCE_INFO.<br/>
     * descSql =  DELETE FROM SEQUENCE_INFO WHERE NAME = #{name,jdbcType=VARCHAR}
     * @param name name
     * @return int
     */
    public int deleteByName(String name){
        return sequenceInfoDOMapper.deleteByName(name);
    }
    /**
     * desc:根据主键获取数据:SEQUENCE_INFO.<br/>
     * descSql =  SELECT * FROM SEQUENCE_INFO WHERE NAME = #{name,jdbcType=VARCHAR}
     * @param name name
     * @return SequenceInfoDO
     */
    public SequenceInfoDO getByName(String name){
        return sequenceInfoDOMapper.getByName(name);
    }
}
